<?php


/**
* Puree CMS
* http://www.molotsoft.ru
*
* @package Puree_CMS
* @subpackage Controllers
* @author Ivan Chistyakov <ivan@molotsoft.ru>
* @version $Id: misc_controller.php 1274 2010-04-05 16:03:22Z molotsoft@gmail.com $
* @link $HeadURL: http://puree-cms.googlecode.com/svn/trunk/controllers/misc_controller.php $
*/


class MiscController extends GeneralController {

/******************************************************************************/

var $name = 'Misc';

var $components = array('Captcha', 'Email');

var $uses = array();

/******************************************************************************/

function admin_sysinfo() {
	// nothing to do
}

/******************************************************************************/

function admin_error404() {
	$this->redirect('/admin', 404);
}

function admin_language($language = 'rus') {
	if ((bool)Configure::read('Project.languages.' . $language)) {
		$this->Session->write('Config.adminLanguage', $language);
	}
	$this->redirect($this->referer('/admin', TRUE));
}

/******************************************************************************/

function error404() {
	$this->redirect('/', 404);
}

function language($language = 'rus') {
	if ((bool)Configure::read('Project.languages.' . $language)) {
		$this->Session->write('Config.language', $language);
	}
	$this->redirect($this->referer('/', TRUE));
}

/******************************************************************************/

function phpinfo() {
	$this->AutomateMethods->disableAll();
	phpinfo();
}

/******************************************************************************/

function captcha() {
	$this->AutomateMethods->disableAll();
	$this->Captcha->draw();
}

function kcaptcha() {
	$this->AutomateMethods->disableAll();
	$this->Captcha->drawKCAPTCHA();
}

/******************************************************************************/

}


?>